﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shop.User.Models
{
    public class UsersInfo
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public int UID { get; set; }
        /// <summary>
        /// 用户登录名
        /// </summary>
        [Required(AllowEmptyStrings = false, ErrorMessage = "用户登录名不能为空!")]
        [StringLength(30, ErrorMessage = "名字长度不能大于30!")]
        public string UName { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        [Required(AllowEmptyStrings = false, ErrorMessage = "密码不能为空!")]
        public string UPass { get; set; }
        [Required(AllowEmptyStrings = false, ErrorMessage = "电子邮箱不能为空!")]
        /// <summary>
        /// 用户电子邮箱
        /// </summary>
        public string Email { get; set; }
        [Required(AllowEmptyStrings = false, ErrorMessage = "电话必须输入")]
        [RegularExpression(@"^(13|17|15|18)\d{9}$", ErrorMessage = "手机号格式输入不正确！")]
        /// <summary>
        /// 用户电话
        /// </summary>
        public string Tel { get; set; }
        /// <summary>
        /// 用户性别
        /// </summary>
        public int Sex { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 是否VIP
        /// </summary>
        public int IfVip { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Createdate { get; set; }
    }
}
